{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 皮马印第安人糖尿病风险预测\n",
    "\n",
    "1)  训练数据和测试数据分割（随机选择 20%的数据作为测试集）；（10 分）\n",
    "2)  适当的特征工程（及数据探索）;（10 分）\n",
    "3)  Logistic 回归，并选择最佳的正则函数（L1/L2）及正则参数；（30 分）\n",
    "4)  线性 SVM，并选择最佳正则参数，比较与 Logistic 回归的性能，简单说明原因。（20 分）\n",
    "5)  RBF 核的 SVM，并选择最佳的超参数（正则参数、RBF 核函数宽度）；（30 分）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 读取数据 & 数据探索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "      <td>148</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>33.6</td>\n",
       "      <td>0.627</td>\n",
       "      <td>50</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>85</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>26.6</td>\n",
       "      <td>0.351</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8</td>\n",
       "      <td>183</td>\n",
       "      <td>64</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>23.3</td>\n",
       "      <td>0.672</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>66</td>\n",
       "      <td>23</td>\n",
       "      <td>94</td>\n",
       "      <td>28.1</td>\n",
       "      <td>0.167</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>137</td>\n",
       "      <td>40</td>\n",
       "      <td>35</td>\n",
       "      <td>168</td>\n",
       "      <td>43.1</td>\n",
       "      <td>2.288</td>\n",
       "      <td>33</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pregnancies  Glucose  BloodPressure  SkinThickness  Insulin   BMI  \\\n",
       "0            6      148             72             35        0  33.6   \n",
       "1            1       85             66             29        0  26.6   \n",
       "2            8      183             64              0        0  23.3   \n",
       "3            1       89             66             23       94  28.1   \n",
       "4            0      137             40             35      168  43.1   \n",
       "\n",
       "   DiabetesPedigreeFunction  Age  Outcome  \n",
       "0                     0.627   50        1  \n",
       "1                     0.351   31        0  \n",
       "2                     0.672   32        1  \n",
       "3                     0.167   21        0  \n",
       "4                     2.288   33        1  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np # linear algebra\n",
    "import pandas as pd # data processing, CSV file I/O\n",
    "\n",
    "from sklearn.metrics import r2_score  #评价回归预测模型的性能\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "#color = sns.color_palette()\n",
    "\n",
    "%matplotlib inline\n",
    "\n",
    "# path to where the data lies\n",
    "#dpath = './data/'\n",
    "data = pd.read_csv(\"diabetes.csv\")\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 768 entries, 0 to 767\n",
      "Data columns (total 9 columns):\n",
      "Pregnancies                 768 non-null int64\n",
      "Glucose                     768 non-null int64\n",
      "BloodPressure               768 non-null int64\n",
      "SkinThickness               768 non-null int64\n",
      "Insulin                     768 non-null int64\n",
      "BMI                         768 non-null float64\n",
      "DiabetesPedigreeFunction    768 non-null float64\n",
      "Age                         768 non-null int64\n",
      "Outcome                     768 non-null int64\n",
      "dtypes: float64(2), int64(7)\n",
      "memory usage: 54.1 KB\n"
     ]
    }
   ],
   "source": [
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pregnancies                 0\n",
       "Glucose                     0\n",
       "BloodPressure               0\n",
       "SkinThickness               0\n",
       "Insulin                     0\n",
       "BMI                         0\n",
       "DiabetesPedigreeFunction    0\n",
       "Age                         0\n",
       "Outcome                     0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>3.845052</td>\n",
       "      <td>120.894531</td>\n",
       "      <td>69.105469</td>\n",
       "      <td>20.536458</td>\n",
       "      <td>79.799479</td>\n",
       "      <td>31.992578</td>\n",
       "      <td>0.471876</td>\n",
       "      <td>33.240885</td>\n",
       "      <td>0.348958</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.369578</td>\n",
       "      <td>31.972618</td>\n",
       "      <td>19.355807</td>\n",
       "      <td>15.952218</td>\n",
       "      <td>115.244002</td>\n",
       "      <td>7.884160</td>\n",
       "      <td>0.331329</td>\n",
       "      <td>11.760232</td>\n",
       "      <td>0.476951</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.078000</td>\n",
       "      <td>21.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>62.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>27.300000</td>\n",
       "      <td>0.243750</td>\n",
       "      <td>24.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>3.000000</td>\n",
       "      <td>117.000000</td>\n",
       "      <td>72.000000</td>\n",
       "      <td>23.000000</td>\n",
       "      <td>30.500000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>0.372500</td>\n",
       "      <td>29.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>6.000000</td>\n",
       "      <td>140.250000</td>\n",
       "      <td>80.000000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>127.250000</td>\n",
       "      <td>36.600000</td>\n",
       "      <td>0.626250</td>\n",
       "      <td>41.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>17.000000</td>\n",
       "      <td>199.000000</td>\n",
       "      <td>122.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>846.000000</td>\n",
       "      <td>67.100000</td>\n",
       "      <td>2.420000</td>\n",
       "      <td>81.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Pregnancies     Glucose  BloodPressure  SkinThickness     Insulin  \\\n",
       "count   768.000000  768.000000     768.000000     768.000000  768.000000   \n",
       "mean      3.845052  120.894531      69.105469      20.536458   79.799479   \n",
       "std       3.369578   31.972618      19.355807      15.952218  115.244002   \n",
       "min       0.000000    0.000000       0.000000       0.000000    0.000000   \n",
       "25%       1.000000   99.000000      62.000000       0.000000    0.000000   \n",
       "50%       3.000000  117.000000      72.000000      23.000000   30.500000   \n",
       "75%       6.000000  140.250000      80.000000      32.000000  127.250000   \n",
       "max      17.000000  199.000000     122.000000      99.000000  846.000000   \n",
       "\n",
       "              BMI  DiabetesPedigreeFunction         Age     Outcome  \n",
       "count  768.000000                768.000000  768.000000  768.000000  \n",
       "mean    31.992578                  0.471876   33.240885    0.348958  \n",
       "std      7.884160                  0.331329   11.760232    0.476951  \n",
       "min      0.000000                  0.078000   21.000000    0.000000  \n",
       "25%     27.300000                  0.243750   24.000000    0.000000  \n",
       "50%     32.000000                  0.372500   29.000000    0.000000  \n",
       "75%     36.600000                  0.626250   41.000000    1.000000  \n",
       "max     67.100000                  2.420000   81.000000    1.000000  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAENCAYAAAD6/JlzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3XmcXFWZ8PHfU9X7vneWTtKddEJICGtI2EVwCYrEGWFkUQEZcePVd9TXgXFk1HEZncV3HBkVQUUUkeEVDRKMKCABQhYgkJ10Op30mvS+7/W8f9zbUBRd3dXd1X2ru57v51Ofrrr33FNP3a6qp+45954jqooxxhgzGp/XARhjjIldliSMMcaEZUnCGGNMWJYkjDHGhGVJwhhjTFiWJIwxxoRlScIYY0xYliSMMcaEZUnC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SSJyEc6X9GT93n2uD4tIons7V0ROdeu/QUSy1ZkopwMn6Y10TJa7X4gjy4fdOncD14uIX5yzqt42Tgw/Bj4hIuvd/ZYuIu8VkczRCqvqyzjTlt4DbFFnXmtwmlTUXYeI3IzbYT9KHY04X+IfcuP8KE67+4gfAneIyGq3rmwRuSZM/A8B7xWRy8WZVOrzQD8wWkIZl3u0toqxz4jaB2wA7hJnakyAXwDvE5F3u68pxe1YLhGRYnE619Pd2Lp44/81liSco+JGYMjt0B4recEE/59m4ixJzG6PikgXzhfnN4AbVfUtH3ZV/TNOW/b/wzk6WIYzwQ+q2ozT5PB5nCaoLwJXqmqTu/n1OL+gW4B/An4+2WBVtRPnQ38tzi/iBt7ohASnf6RKRDpwmio+5C5fDvwJ58tmG/Dfqvq0u+6zOIlrpOnqt+PEsAunb+H7OP0oFTjt5GP5Fc5sbw8E1bMf+Hc3nhPAGuC5Mer4GE6zTTOwmqAvdVV9BGc/POi+9r2MPt0oqnoIZ7/8F06n//twToUeGOc1BBs5+6kL5/TXf1TVx8faQJ35kq8EfiwiV6hqNc4Uqf+A86Ve7b4+n3v7PM7/uAUncX9qvKDc98dncBJhK857b8xJvCb5/zQTYPNJGGOMCcuOJIwxxoRlScIYY0xYliSMMcaEZUnCGGNMWJYkjDHGhGVJwhhjTFiWJIwxxoRlScIYY0xYliSMMcaE9f8BjpJrmfOMU3YAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xe880748>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 目标y registered的直方图／分布\n",
    "fig = plt.figure()\n",
    "sns.distplot(data.BloodPressure.values, bins=30, kde=True)\n",
    "plt.xlabel('BloodPressure value of Bikeshare', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEKCAYAAAAIO8L1A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ElwNfHJ0F47mMlpyQ5o0BocXuDuAXxhuSvJDRCreP8PRR9g/s5hh9w2S8z+Pt/cmx7Zn9JcB3gU9X1Rt6HFcahKeYtNhtBJ6f5Cz43iNYL2L0qMu7gaOT7JPkSEZP35vxT0meM3aMM5Mc0o5xcGv/X4xWxwV4I/CFPajrRuD4JC9rx3x+kh/c019O2hsGhBa1Gq1W+fPAGUnuAv438Bijq5S+CPwf4Dbg94Cbxr66Hrg1yRVt9dt3A59L8mXg/a3PrwNvSXIr8CaempvoU9d24M3Ax9v3bwT+xff7e0rfD1dzlSR1cgQhSepkQEiSOhkQkqROBoQkqZMBIUnqZEBIkjoZEJKkTgaEJKnT/wdTVAC3dgOTgAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xec419b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.countplot(data.Outcome);\n",
    "plt.xlabel('Outcome');\n",
    "plt.ylabel('Number of Outcome');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(614, 8)"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 从原始数据中分离输入特征x和输出y\n",
    "y = data['Outcome'].values\n",
    "X = data.drop(columns=['Outcome'])\n",
    "\n",
    "#用于后续显示权重系数对应的特征\n",
    "columns = X.columns\n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "# 随机采样20%的数据构建测试样本，其余作为训练样本\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=33, test_size=0.2)\n",
    "X_train.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 对等于0的数据进行填补"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 19, 316, 252, 131, 291,  57, 484,   2], dtype=int64)"
      ]
     },
     "execution_count": 117,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 数据标准化\n",
    "from sklearn.preprocessing import Imputer\n",
    "\n",
    "# 初始化特征的标准化器\n",
    "ss_X = Imputer(missing_values=0)\n",
    "\n",
    "# 分别对训练和测试数据的特征进行标准化处理\n",
    "X_train = ss_X.fit_transform(X_train)\n",
    "#X_test = ss_X.transform(X_test)\n",
    "\n",
    "X_train.argmin(axis=0)\n",
    "#检查X_train中为0的是否填充"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 正则化的 Logistic Regression及参数调优"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of each fold is:  [0.48086029 0.47324411 0.52714467 0.45772386 0.49712546]\n",
      "cv logloss is: 0.48721967989736037\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "lr= LogisticRegression()\n",
    "\n",
    "# 交叉验证用于评估模型性能和进行参数调优（模型选择）\n",
    "#分类任务中交叉验证缺省是采用StratifiedKFold\n",
    "from sklearn.cross_validation import cross_val_score\n",
    "loss = cross_val_score(lr, X_train, y_train, cv=5, scoring='neg_log_loss')\n",
    "print 'logloss of each fold is: ',-loss\n",
    "print'cv logloss is:', -loss.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'penalty': ['l1', 'l2'], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=0)"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "#需要调优的参数\n",
    "# 请尝试将L1正则和L2正则分开，并配合合适的优化求解算法（slover）\n",
    "#tuned_parameters = {'penalty':['l1','l2'],\n",
    "#                   'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "#                   }\n",
    "penaltys = ['l1','l2']\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "tuned_parameters = dict(penalty = penaltys, C = Cs)\n",
    "\n",
    "lr_penalty= LogisticRegression()\n",
    "grid= GridSearchCV(lr_penalty, tuned_parameters,cv=5, scoring='neg_log_loss')\n",
    "grid.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'mean_fit_time': array([0.00180001, 0.00099998, 0.00239997, 0.00099998, 0.00420003,\n",
       "        0.00159993, 0.0066    , 0.00260005, 0.00740004, 0.0026    ,\n",
       "        0.00680008, 0.00259995, 0.00700002, 0.00280004]),\n",
       " 'mean_score_time': array([0.00119996, 0.00079999, 0.00099998, 0.00079999, 0.00060005,\n",
       "        0.00080004, 0.00040002, 0.00040002, 0.0006    , 0.00020003,\n",
       "        0.00099993, 0.00040002, 0.00080004, 0.00020003]),\n",
       " 'mean_test_score': array([-0.6554898 , -0.58949867, -0.59805684, -0.58167743, -0.53084105,\n",
       "        -0.55375306, -0.47097386, -0.48724123, -0.47051551, -0.47041018,\n",
       "        -0.47057619, -0.47040758, -0.47058982, -0.47049488]),\n",
       " 'mean_train_score': array([-0.65450363, -0.58053365, -0.59112856, -0.56994742, -0.51868124,\n",
       "        -0.54118233, -0.45555691, -0.47403694, -0.45432871, -0.45504557,\n",
       "        -0.45431514, -0.45433322, -0.45431468, -0.45432211]),\n",
       " 'param_C': masked_array(data=[0.001, 0.001, 0.01, 0.01, 0.1, 0.1, 1, 1, 10, 10, 100,\n",
       "                    100, 1000, 1000],\n",
       "              mask=[False, False, False, False, False, False, False, False,\n",
       "                    False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'param_penalty': masked_array(data=['l1', 'l2', 'l1', 'l2', 'l1', 'l2', 'l1', 'l2', 'l1',\n",
       "                    'l2', 'l1', 'l2', 'l1', 'l2'],\n",
       "              mask=[False, False, False, False, False, False, False, False,\n",
       "                    False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'params': [{'C': 0.001, 'penalty': 'l1'},\n",
       "  {'C': 0.001, 'penalty': 'l2'},\n",
       "  {'C': 0.01, 'penalty': 'l1'},\n",
       "  {'C': 0.01, 'penalty': 'l2'},\n",
       "  {'C': 0.1, 'penalty': 'l1'},\n",
       "  {'C': 0.1, 'penalty': 'l2'},\n",
       "  {'C': 1, 'penalty': 'l1'},\n",
       "  {'C': 1, 'penalty': 'l2'},\n",
       "  {'C': 10, 'penalty': 'l1'},\n",
       "  {'C': 10, 'penalty': 'l2'},\n",
       "  {'C': 100, 'penalty': 'l1'},\n",
       "  {'C': 100, 'penalty': 'l2'},\n",
       "  {'C': 1000, 'penalty': 'l1'},\n",
       "  {'C': 1000, 'penalty': 'l2'}],\n",
       " 'rank_test_score': array([14, 12, 13, 11,  9, 10,  7,  8,  4,  2,  5,  1,  6,  3]),\n",
       " 'split0_test_score': array([-0.65372793, -0.61452164, -0.63756042, -0.59292814, -0.54066131,\n",
       "        -0.55907529, -0.45324095, -0.48086029, -0.44855101, -0.45157077,\n",
       "        -0.44816933, -0.44841872, -0.44815302, -0.44819949]),\n",
       " 'split0_train_score': array([-0.65007363, -0.57756424, -0.58746329, -0.56944258, -0.52267489,\n",
       "        -0.54161635, -0.46085633, -0.47793005, -0.45970716, -0.46033182,\n",
       "        -0.4596941 , -0.45970136, -0.45969399, -0.4596943 ]),\n",
       " 'split1_test_score': array([-0.65460695, -0.55553087, -0.56832522, -0.54029858, -0.49737506,\n",
       "        -0.51622518, -0.47282118, -0.47324411, -0.47714394, -0.47368277,\n",
       "        -0.47765516, -0.47727337, -0.4777124 , -0.47775353]),\n",
       " 'split1_train_score': array([-0.6576497 , -0.5907394 , -0.60217858, -0.58119061, -0.51807348,\n",
       "        -0.54895816, -0.45447102, -0.47486588, -0.45319221, -0.45397153,\n",
       "        -0.45317813, -0.45318723, -0.45317769, -0.45317745]),\n",
       " 'split2_test_score': array([-0.65787542, -0.60884424, -0.61329193, -0.60802391, -0.55739123,\n",
       "        -0.58454353, -0.51634056, -0.52714467, -0.5204574 , -0.51852773,\n",
       "        -0.52100756, -0.5202591 , -0.5210587 , -0.52033879]),\n",
       " 'split2_train_score': array([-0.65338492, -0.57383111, -0.58393855, -0.56190262, -0.50922482,\n",
       "        -0.53231058, -0.44357723, -0.46288745, -0.44229027, -0.44315691,\n",
       "        -0.44227591, -0.44232493, -0.44227569, -0.44231107]),\n",
       " 'split3_test_score': array([-0.65480607, -0.57632313, -0.58446663, -0.57421981, -0.51974675,\n",
       "        -0.54379991, -0.42620432, -0.45772386, -0.41860437, -0.42261383,\n",
       "        -0.41797524, -0.41840778, -0.41785221, -0.41808707]),\n",
       " 'split3_train_score': array([-0.65466071, -0.58239223, -0.59245275, -0.57073031, -0.52773722,\n",
       "        -0.54472362, -0.46790749, -0.48401949, -0.46677412, -0.46733166,\n",
       "        -0.46676188, -0.46677397, -0.46676128, -0.46676254]),\n",
       " 'split4_test_score': array([-0.65644921, -0.5919831 , -0.58611123, -0.59285548, -0.53892661,\n",
       "        -0.56508934, -0.48616598, -0.49712546, -0.4877172 , -0.48554342,\n",
       "        -0.48796958, -0.48757451, -0.48806855, -0.48799297]),\n",
       " 'split4_train_score': array([-0.65674917, -0.57814126, -0.58960964, -0.566471  , -0.51569579,\n",
       "        -0.53830293, -0.45097249, -0.47048183, -0.4496798 , -0.45043591,\n",
       "        -0.44966568, -0.4496786 , -0.44966475, -0.44966517]),\n",
       " 'std_fit_time': array([7.48379193e-04, 6.32485089e-04, 7.99989707e-04, 9.53674316e-08,\n",
       "        7.48315479e-04, 4.89901382e-04, 1.35647314e-03, 4.89862441e-04,\n",
       "        8.00013548e-04, 4.89920847e-04, 1.16620399e-03, 8.00013548e-04,\n",
       "        8.94522303e-04, 1.16610585e-03]),\n",
       " 'std_score_time': array([0.00097981, 0.00039999, 0.00063241, 0.00074829, 0.00048994,\n",
       "        0.00040002, 0.00048992, 0.00048992, 0.00079997, 0.00040007,\n",
       "        0.        , 0.00048992, 0.00040002, 0.00040007]),\n",
       " 'std_test_score': array([0.00148287, 0.02163985, 0.02457208, 0.02331296, 0.02055465,\n",
       "        0.02286888, 0.03034135, 0.02364272, 0.03464274, 0.03220348,\n",
       "        0.03508283, 0.03465204, 0.0351484 , 0.03485987]),\n",
       " 'std_train_score': array([0.00267736, 0.0057806 , 0.00618537, 0.00638876, 0.00627162,\n",
       "        0.00566024, 0.00832261, 0.00710556, 0.00838623, 0.00827811,\n",
       "        0.00838699, 0.00837576, 0.00838697, 0.0083772 ])}"
      ]
     },
     "execution_count": 120,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grid.cv_results_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.4704075816747057\n",
      "{'penalty': 'l2', 'C': 100}\n"
     ]
    }
   ],
   "source": [
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEKCAYAAAA1qaOTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEg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unTwE+AFuBl4EBEfLzaVJMj6Urgx0ATsCkibq84Ui6StgAfIZvZ9gjQEREbKw2Vg6RFwCNAF9nfOsDaiHiwulT5SLoI+DnZ79YZwC8j4julvZ8bipmZFcGnvMzMrBBuKGZmVgg3FDMzK4QbipmZFcINxczMCuGGYlYgSf3j7zXm8b+W9Pa0PEfSOknPpJli90i6TNLMtOwPJltNcUMxqxGSFgBNEXEobdpANtni/IhYAFwHzE2TSO4CllcS1GwUbihmJVDmjjTnWJek5Wn7GZJ+lkYcD0h6UNI16bBrgfvSfu8ALgNujohTAGlG4h1p3+1pf7Oa4SGzWTk+A1wCXEz2yfH9kvYAC4ELgfcBbyabGn1TOmYhsCUtLyD71P/gKK/fDXyglORmOXmEYlaORcCWNNPrEeD3ZA1gEfCriDgVES8Cu4cd0wr0TeTFU6N5JT0AyqwmuKGYlWOkaenH2g5wHJiVlp8ALpY01t/oWcB/cmQzK4Ubilk59gDL08ONWoDLgX1kj2D9bLqW8hayyRSH9ADvBIiIZ4BO4NY0+y2S5g89A0bSm4C+iBiYroLMxuOGYlaObcDjwGPAw8DqdIprK9kzULqBdWRPAvxHOmYHr24w1wPnAb2SuoA7+d+zUj4K1N3st9bYPNuw2TSTNCci+tMoYx+wMCJeTM+r2J3WR7sYP/Qa9wLfjoiD0xDZbEJ8l5fZ9HsgPfRoJnBbGrkQEccldZA9U/6vox2cHsS13c3Eao1HKGZmVghfQzEzs0K4oZiZWSHcUMzMrBBuKGZmVgg3FDMzK4QbipmZFeK/v7PCHlS7TsoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xda2dc18>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# plot CV误差曲线\n",
    "test_means = grid.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid.cv_results_[ 'std_test_score' ]\n",
    "train_means = grid.cv_results_[ 'mean_train_score' ]\n",
    "train_stds = grid.cv_results_[ 'std_train_score' ]\n",
    "\n",
    "\n",
    "# plot results\n",
    "n_Cs = len(Cs)\n",
    "number_penaltys = len(penaltys)\n",
    "test_scores = np.array(test_means).reshape(n_Cs,number_penaltys)\n",
    "train_scores = np.array(train_means).reshape(n_Cs,number_penaltys)\n",
    "test_stds = np.array(test_stds).reshape(n_Cs,number_penaltys)\n",
    "train_stds = np.array(train_stds).reshape(n_Cs,number_penaltys)\n",
    "\n",
    "x_axis = np.log10(Cs)\n",
    "for i, value in enumerate(penaltys):\n",
    "    #pyplot.plot(log(Cs), test_scores[i], label= 'penalty:'   + str(value))\n",
    "    pyplot.errorbar(x_axis, test_scores[:,i], yerr=test_stds[:,i] ,label = penaltys[i] +' Test')\n",
    "    pyplot.errorbar(x_axis, train_scores[:,i], yerr=train_stds[:,i] ,label = penaltys[i] +' Train')\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'neg-logloss' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 线性SVM正则参数调优"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Classification report for classifier LinearSVC(C=1.0, class_weight=None, dual=True, fit_intercept=True,\n",
      "     intercept_scaling=1, loss='squared_hinge', max_iter=1000,\n",
      "     multi_class='ovr', penalty='l2', random_state=None, tol=0.0001,\n",
      "     verbose=0):\n",
      "             precision    recall  f1-score   support\n",
      "\n",
      "          0       0.83      0.24      0.37        99\n",
      "          1       0.40      0.91      0.56        55\n",
      "\n",
      "avg / total       0.67      0.48      0.44       154\n",
      "\n",
      "\n",
      "Confusion matrix:\n",
      "[[24 75]\n",
      " [ 5 50]]\n"
     ]
    }
   ],
   "source": [
    "#LinearSVC不能得到每类的概率，在Otto数据集要求输出每类的概率，这里只是示意SVM的使用方法\n",
    "#https://xacecask2.gitbooks.io/scikit-learn-user-guide-chinese-version/content/sec1.4.html\n",
    "#1.4.1.2. 得分与概率\n",
    "from sklearn.svm import LinearSVC\n",
    "\n",
    "#SVM并不能直接输出各类的概率，所以在这个例子中我们用正确率作为模型预测性能的度量\n",
    "from sklearn.metrics import classification_report\n",
    "from sklearn.metrics import confusion_matrix\n",
    "\n",
    "SVC1 = LinearSVC().fit(X_train, y_train)\n",
    "\n",
    "#在校验集上测试，估计模型性能\n",
    "y_predict = SVC1.predict(X_test)\n",
    "\n",
    "print(\"Classification report for classifier %s:\\n%s\\n\"\n",
    "      % (SVC1, classification_report(y_test, y_predict)))\n",
    "print(\"Confusion matrix:\\n%s\" % confusion_matrix(y_test, y_predict))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [],
   "source": [
    "def fit_grid_point_Linear(C, X_train, y_train, X_test, y_test):\n",
    "    \n",
    "    # 在训练集是那个利用SVC训练\n",
    "    SVC2 =  LinearSVC( C = C)\n",
    "    SVC2 = SVC2.fit(X_train, y_train)\n",
    "    \n",
    "    # 在校验集上返回accuracy\n",
    "    accuracy = SVC2.score(X_test, y_test)\n",
    "    \n",
    "    print(\"accuracy: {}\".format(accuracy))\n",
    "    return accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.720779220779\n",
      "accuracy: 0.694805194805\n",
      "accuracy: 0.506493506494\n",
      "accuracy: 0.525974025974\n",
      "accuracy: 0.688311688312\n",
      "accuracy: 0.688311688312\n",
      "accuracy: 0.675324675325\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0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p6WEEhxURnFiIikpPmLEREJCeFhYiI5KSwEBGRnBQWIiKSk8JCRERyUliIiEhO/x/IxSKIcxHGIAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xe9f4128>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-3, 3, 7)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份  \n",
    "#penalty_s = ['l1','l2']\n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "#    for j, penalty in enumerate(penalty_s):\n",
    "    tmp = fit_grid_point_Linear(oneC, X_train, y_train, X_test, y_test)\n",
    "    accuracy_s.append(tmp)\n",
    "\n",
    "x_axis = np.log10(C_s)\n",
    "#for j, penalty in enumerate(penalty_s):\n",
    "pyplot.plot(x_axis, np.array(accuracy_s), 'b-')\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'accuracy' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=LinearSVC(C=1.0, class_weight=None, dual=True, fit_intercept=True,\n",
       "     intercept_scaling=1, loss='hinge', max_iter=1000, multi_class='ovr',\n",
       "     penalty='l2', random_state=None, tol=0.0001, verbose=0),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'penalty': ['l2'], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring=None, verbose=0)"
      ]
     },
     "execution_count": 143,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.svm import LinearSVC\n",
    "\n",
    "penaltys = ['l2']\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "tuned_parameters = dict(penalty = penaltys, C = Cs)\n",
    "\n",
    "lsvc_penalty= LinearSVC(loss='hinge')\n",
    "grid= GridSearchCV(lsvc_penalty, tuned_parameters,cv=5)\n",
    "grid.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.7084690553745928\n",
      "{'penalty': 'l2', 'C': 0.001}\n"
     ]
    }
   ],
   "source": [
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## RBF核SVM正则参数调优"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma='auto', kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000], 'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring=None, verbose=0)"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.svm import SVC\n",
    "\n",
    "#需要调优的参数\n",
    "# 请尝试将L1正则和L2正则分开，并配合合适的优化求解算法（slover）\n",
    "#tuned_parameters = {'penalty':['l1','l2'],\n",
    "#                   'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "#                   }\n",
    "gamma = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "tuned_parameters = dict(gamma = gamma, C = Cs)\n",
    "\n",
    "rbf_penalty = SVC(kernel='rbf')\n",
    "grid= GridSearchCV(rbf_penalty, tuned_parameters, cv=5)\n",
    "grid.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.739413680781759\n",
      "{'C': 1, 'gamma': 0.001}\n"
     ]
    }
   ],
   "source": [
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
